***************************************************************
***  I'LL BE BACK? EXILED LEADERS AND POLITICAL INSTABILITY ***
***   KRCMARIC AND ESCRIBA-FOLCH'S JCR REPLICATION Do FILE  ***
***************************************************************


****** MODELS REPORTED IN THE PAPER ******
 
 
***TABLE 3***
*Analysis of civil conflict (replication and extension of Wimmer, Cederman, and Min 2009)
use "Civil Conflict Replication Data", clear
logit newonset lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 anocl oilpcl ongoingwarl year npeaceyears nspline*,  nolog cluster(cowcode)
logit newonset any_exiled_leaders_jan1 lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 anocl oilpcl ongoingwarl year npeaceyears nspline*,  nolog cluster(cowcode)
logit newonset any_exiled_leaders_jan1 lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 oilpcl ongoingwarl year npeaceyears nspline* if autocl==1,  nolog cluster(cowcode)
logit newonset any_exiled_leaders_jan1 lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 oilpcl ongoingwarl year npeaceyears nspline* if anocl==1,  nolog cluster(cowcode)
logit newonset any_exiled_leaders_jan1 lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 oilpcl ongoingwarl year npeaceyears nspline* if democl==1,  nolog cluster(cowcode)


***FIGURE 1***
*First differences 
use "Civil Conflict Replication Data", clear
eststo clear
estsimp logit newonset any_exiled_leaders_jan1 lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 anocl oilpcl ongoingwarl year npeaceyears nspline*,  nolog cluster(cowcode)
setx median
simqi, fd(prval(1)) changex(any_exiled_leaders_jan1 0 1) level(90)
setx median
simqi, fd(prval(1)) changex(lrexclpop 0.27497 3.452148) level(90)
setx median
simqi, fd(prval(1)) changex(egipgrps 0 3.46) level(90)
setx median
simqi, fd(prval(1)) changex(pimppast 0 1) level(90)
setx median
simqi, fd(prval(1)) changex(ethfrac .1 .66) level(90)
setx median
simqi, fd(prval(1)) changex(gdpcapl .027 13.25) level(90)
setx median
simqi, fd(prval(1)) changex(lpopl 7.79 10.57) level(90)
setx median
simqi, fd(prval(1)) changex(lmtnest .81 3.59) level(90)
setx median
simqi, fd(prval(1)) changex(regchg3 0 1) level(90)
setx median
simqi, fd(prval(1)) changex(anocl 0 1) level(90)
setx median
simqi, fd(prval(1)) changex(oilpcl 0 15.16) level(90)
setx median
simqi, fd(prval(1)) changex(ongoingwarl 0 1) level(90)
drop b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 b18


***FIGURE 2***
*Does time in exile matter?
use "Civil Conflict Replication Data", clear
eststo clear
logit newonset noexileyears lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  i.regchg3 i.anocl oilpcl i.ongoingwarl year npeaceyears nspline* if any_exiled_leaders_jan1==1,  nolog cluster(cowcode)
margins, at(noexileyears=(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30)) 


***TABLE 4***
*Analysis of irregular leadership transitions (Archigos)
use "Irregular Transitions Replication Data", clear
eststo clear
logit irregular_exit exile_window_10 if exile_window_10==1 | death_window_10==1, cluster(ccode)
logit irregular_exit exile_window_7 if exile_window_7==1 | death_window_7==1, cluster(ccode)
xtlogit irregular_exit exile_window_10 if exile_window_10==1 | death_window_10==1, i(ccode) vce(cluster ccode)
xtlogit irregular_exit exile_window_7 if exile_window_7==1 | death_window_7==1, i(ccode) vce(cluster ccode)



****** MODELS REPORTED IN THE APPENDIX ******


***APPENDIX TABLE 2***
*No January 1 coding rule
use "Civil Conflict Replication Data", clear
eststo clear
logit newonset any_exiled_leaders lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 anocl oilpcl ongoingwarl year npeaceyears nspline*,  nolog cluster(cowcode)
logit newonset any_exiled_leaders lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 oilpcl ongoingwarl year npeaceyears nspline* if autocl==1,  nolog cluster(cowcode)
logit newonset any_exiled_leaders lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 oilpcl ongoingwarl year npeaceyears nspline* if anocl==1,  nolog cluster(cowcode)
logit newonset any_exiled_leaders lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 oilpcl ongoingwarl year npeaceyears nspline* if democl==1,  nolog cluster(cowcode)


***APPENDIX TABLE 3***
*Random effects
use "Civil Conflict Replication Data", clear
eststo clear
xtlogit newonset any_exiled_leaders_jan1 lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 anocl oilpcl ongoingwarl year npeaceyears nspline*, i(ccode) vce(cluster ccode)
xtlogit newonset any_exiled_leaders_jan1 lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 oilpcl ongoingwarl year npeaceyears nspline* if autocl==1, i(ccode) vce(cluster ccode)
xtlogit newonset any_exiled_leaders_jan1 lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 oilpcl ongoingwarl year npeaceyears nspline* if anocl==1, i(ccode) vce(cluster ccode)
xtlogit newonset any_exiled_leaders_jan1 lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 oilpcl ongoingwarl year npeaceyears nspline* if democl==1, i(ccode) vce(cluster ccode)


***APPENDIX TABLE 4***
*Exiled leaders count variable
use "Civil Conflict Replication Data", clear
eststo clear
logit newonset total_exiled_leaders_jan1 lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 anocl oilpcl ongoingwarl year npeaceyears nspline*,  nolog cluster(cowcode)
logit newonset total_exiled_leaders_jan1 lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 oilpcl ongoingwarl year npeaceyears nspline* if autocl==1,  nolog cluster(cowcode)
logit newonset total_exiled_leaders_jan1 lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 oilpcl ongoingwarl year npeaceyears nspline* if anocl==1,  nolog cluster(cowcode)
logit newonset total_exiled_leaders_jan1 lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 oilpcl ongoingwarl year npeaceyears nspline* if democl==1,  nolog cluster(cowcode)


***APPENDIX TABLE 5***
*Exiled leaders count variable (logged)
use "Civil Conflict Replication Data", clear
eststo clear
gen log_total_exiled_leaders_jan1=ln(1+total_exiled_leaders_jan1)
logit newonset log_total_exiled_leaders_jan1 lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 anocl oilpcl ongoingwarl year npeaceyears nspline*,  nolog cluster(cowcode)
logit newonset log_total_exiled_leaders_jan1 lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 oilpcl ongoingwarl year npeaceyears nspline* if autocl==1,  nolog cluster(cowcode)
logit newonset log_total_exiled_leaders_jan1 lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 oilpcl ongoingwarl year npeaceyears nspline* if anocl==1,  nolog cluster(cowcode)
logit newonset log_total_exiled_leaders_jan1 lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 oilpcl ongoingwarl year npeaceyears nspline* if democl==1,  nolog cluster(cowcode)


***APPENDIX TABLE 6***
*Does time in exile matter?
use "Civil Conflict Replication Data", clear
eststo clear
logit newonset noexileyears lrexclpop  egipgrps pimppast  ethfrac  gdpcapl lpopl lmtnest  regchg3 anocl oilpcl ongoingwarl year npeaceyears nspline* if any_exiled_leaders_jan1==1,  nolog cluster(cowcode)


***APPENDIX TABLE 7***
*Analysis of coup attempts (replication and extension of Houle 2016)
use "Coups Replication Data", clear
eststo clear
logit failed_pow lcapshare lgdptreis lonegrowthtreis L.lnoil_gas_valuePOP_2009 regch3 lopen lethnic lpolity lpolitysq cold dec60 dec70 dec80 dec90 succpowyears _spline1sucpow _spline2sucpow _spline3sucpow if year>=1960 & western==0, robust
logit failed_pow any_exiled_leaders_jan1 lcapshare lgdptreis lonegrowthtreis L.lnoil_gas_valuePOP_2009 regch3 lopen lethnic lpolity lpolitysq cold dec60 dec70 dec80 dec90 succpowyears _spline1sucpow _spline2sucpow _spline3sucpow if year>=1960 & western==0, robust
logit failed_pow total_exiled_leaders_jan1 lcapshare lgdptreis lonegrowthtreis L.lnoil_gas_valuePOP_2009 regch3 lopen lethnic lpolity lpolitysq cold dec60 dec70 dec80 dec90 succpowyears _spline1sucpow _spline2sucpow _spline3sucpow if year>=1960 & western==0, robust


***APPENDIX TABLE 8***
*Analysis of protests (replication and extension of Escriba-Folch, Meseguer, and Wright 2018)
use "Protests Replication Data", clear
eststo clear
global y = "Protest"
global f = "i.period i.cow"
global cvar = "l1gdp l1pop l1nbr5 l12gr l1migr elec3"
xi:ivreg2 $y $f $cvar remit dict if s==1,cluster(case) partial(i.cow i.period)
xi:ivreg2 $y $f $cvar remit dict any_exiled_leaders_jan1 if s==1,cluster(case) partial(i.cow i.period)
xi:ivreg2 $y $f $cvar remit dict total_exiled_leaders_jan1 if s==1,cluster(case) partial(i.cow i.period)


***APPENDIX TABLE 9***
*Do imprisoned leader destabilize? 
use "Irregular Transitions Replication Data", clear
eststo clear
logit irregular_exit arrest_window_10 if death_window_10==1 | arrest_window_10==1, cluster(ccode)
logit irregular_exit arrest_window_7 if death_window_7==1 | arrest_window_7==1, cluster(ccode)




